package com.pojo;

import java.util.List;

public class Page {
    private Integer currentPageNo; //当前是第几页
    private Integer pageSize; //一页几天
    private Integer count; //数据总数
    private Integer totalPageSize; //一共可以分几页
    private List<Demo> list;

    private Integer getSize(){
        return (this.count + this.pageSize - 1) / this.pageSize;
    }

    public Integer getCurrentPageNo() {
        return currentPageNo;
    }

    public void setCurrentPageNo(Integer currentPageNo) {
        this.currentPageNo = currentPageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
        this.totalPageSize = getSize();
    }

    public Integer getTotalPageSize() {
        return totalPageSize;
    }

    public void setTotalPageSize(Integer totalPageSize) {
        this.totalPageSize = totalPageSize;
    }

    public List<Demo> getList() {
        return list;
    }

    public void setList(List<Demo> list) {
        this.list = list;
    }
}
